    Ext.ns("XIINN.ui");  
    /** 
     * 下拉列表选择树 
     * <br> 
     * 依赖EXTJS3版本 
     * @class XIINN 
     * @extends Ext.form.ComboBox 
     */  
    XIINN.ui.ComboBoxTree = Ext.extend(Ext.form.ComboBox, {  
        /** 
         * 回调函数,用于传递combox，node对象 
         * @type 
         */  
    	id:this.id||'_xiinn-combox',
        callback : Ext.emptyFn,  
        store : new Ext.data.SimpleStore({  
                    fields : [],  
                    data : [[]]  
                }),  
        editable : this.editable||false,  
        mode : 'local',  
        emptyText : this.emptyText||"请选择",  
        allowBlank : this.allowBlank||true,  
        blankText : this.blankText||"必须输入!",  
        triggerAction : 'all',  
        maxHeight : 200,  
        anchor : '95%',  
        displayField : 'text',  
        valueField : 'id',  
        tpl : "<tpl for='.'><div style='height:200px'><div id='tree'></div></div></tpl>",  
        selectedClass : '',  
        onSelect : Ext.emptyFn,  
        /** 
         * 根的名字 
         *  
         * @type String 
         */  
        rootText : this.rootText||'root',  
        rootId:this.rootId||'_xiinn',
        expanded:this.expanded||false,
        leaf:this.leaf||true,
        /** 
         * 树的请求地址 
         *  
         * @type String 
         */  
        treeUrl : this.treeUrl,  
        tree : null,  
        initComponent : function() {  
            this.tree = new Ext.tree.TreePanel({  
                height : 200,  
                scope : this,  
                autoScroll : true,  
                animate : true,  
                split : true,  
                id:'XIINN-COMBOX-TREE',
                root : new Ext.tree.AsyncTreeNode({  
                            expanded : this.expanded,  
                            id : this.rootId,  
                            text : this.rootText  
                        }),  
      
                loader : new Ext.tree.TreeLoader({  
                            dataUrl : this.treeUrl  
                        }),  
                rootVisible : true  
                });  
            var c = this;  
            /** 
             * 点击选中节点并回调传值 
             */  
            this.tree.on('click', function(node) {  
                        if (node.id != null && node.id != '') {  
                                //c.setValue(node.text);  
                                c.callback.call(this, c, node);  
                                //c.collapse();  
                        }  
                    })  
                    this.tree.on('beforeload', function(node) {  
                    	if (node.id != '') {
    						Ext.getCmp("XIINN-COMBOX-TREE").loader.dataUrl =  Ext.getCmp("XIINN-COMBOX-TREE").loader.dataUrl+node.id
    					}
                    });  
            this.on('expand', function(node) {  
                        this.tree.render('tree');  
                    });  
      
            XIINN.ui.ComboBoxTree.superclass.initComponent.call(this);  
        },  
	    onViewClick : function(doFocus){
	        if(doFocus !== false){
	            this.el.focus();  
	        }else{
	        	c.collapse();  
	        }
	    }
    }) 
